<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<head>
    <link rel="stylesheet" type="text/css" href="/css/style_member.css" />
    <title>会员注册-笔飞美术作品</title>
    <%@include file="../common/jspcommon.jsp"%>
	<%@include file="../common/css.jsp"%>
	<%@include file="../common/js.jsp"%>
	<script type="text/javascript" src="js/base.js"></script>
	<!-- <style type="text/css">  
	.file-box{ position:relative;width:340px} 
	.txt{ height:22px; border:1px solid #cdcdcd; width:180px;} 
	.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;} 
	.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
	</style> -->
</head>

<body>
<div id="box">
  <%@include file="../common/header.jsp"%>
    <div id="main_div">
        <div class="site_map"><a href="/welcome.htm">首页</a> 》我的定制</div>
        
        <div id="member_div_2">
            <table cellpadding="0" cellspacing="0" class="member_table">
                <tr>
                    <td class="td_1" valign="top">
                        <div class="left_nav">
                        <ul>
	                            <li><a href="/member.htm">控制面板</a></li>
	                            <li	><a href="/memberInfo.htm">个人资料</a></li>
	                            <li	><a href="/mOrders.htm">我的订单</a></li>
	                            <li class="cur"><a href="/mMade.htm">我的定制</a></li>
	                            <li ><a href="/mActivity.htm">我的活动</a></li>
	                            <li><a href="/mHas.htm">关注收藏欣赏</a></li>
	                            <li><a href="mComment.htm">评论管理</a></li>
	                            <li><a href="mPay.htm">支付保证金</a></li>
	                        </ul>
                        </div>
                    </td>
                    <td class="td_2" valign="top">
                        <div>
                            <table cellpadding="10" cellspacing="1" class="member_table2" style="text-align:left;">
                                <tr class="td2">
                                    <td style="width:120px;"><b>定制编号：</b></td>
                                    <td style="width:240px;">Dz${artMade.identifier}
                                    <input  type="hidden" id="madeId" value="${artMade.identifier}"/>
                                    </td>
                                    <td style="width:120px;"><b>定制时间：</b></td>
                                    <td><fmt:formatDate value="${artMade.gmtCreated}" pattern="yyyy-MM-dd HH:mm:SS" /></td>
                                </tr>
                                <tr class="td1">
                                    <td style="width:120px;"><b>定制者：</b></td>
                                    <td style="width:240px;">${artMade.madeName}</td>
                                    <td style="width:120px;"><b>艺术家：</b></td>
                                    <td>${artMade.artist.name}</td>
                                </tr>
                                <tr class="td2">
                                    <td style="width:12%;" valign="top"><b>留言：</b></td>
                                    <td colspan="3"><textarea id="content" cols="20" rows="2" class="input3"></textarea></td>
                                </tr>
                               
                              <form id="upload_img_form1" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
                                <tr class="td2">
                                    <td style="width:12%;" valign="top"><b>图片1：</b></td>
                                   
                                    <td colspan="3">
	                                     <input type="file" onchange="uploadImg(this,1);return false;"   name="imagef1" id="imagef1" style="width: 250px;height: 50px"/>
	                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image1');"/>　
	                                   	<input name="image1" type="hidden" id="image1" value="" /><br />只支持JPG、GIF、PNG格式
                                    </td>
                                </tr>
                               </form>
                               <form id="upload_img_form2" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片2：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,2);return false;"   name="imagef2" id="imagef2" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image2');"/>　
					                                   	<input name="image2" type="hidden" id="image2" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                 <form id="upload_img_form3" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片3：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,3);return false;"   name="imagef3" id="imagef3" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image3');"/>　
					                                   	<input name="image3" type="hidden" id="image3" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                 
                                   <form id="upload_img_form4" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片4：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,4);return false;"   name="imagef4" id="imagef4" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image4');"/>　
					                                   	<input name="image4" type="hidden" id="image4" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                 <form id="upload_img_form5" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片5：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,5);return false;"   name="imagef5" id="imagef5" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image5');"/>　
					                                   	<input name="image5" type="hidden" id="image5" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                 <form id="upload_img_form6" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片6：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,6);return false;"   name="imagef6" id="imagef6" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image6');"/>　
					                                   	<input name="image6" type="hidden" id="image6" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                  <form id="upload_img_form7" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片7：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,7);return false;"   name="imagef7" id="imagef7" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image7');"/>　
					                                   	<input name="image7" type="hidden" id="image7" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                  <form id="upload_img_form8" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片8：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,8);return false;"   name="imagef8" id="imagef8" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image8');"/>　
					                                   	<input name="image8" type="hidden" id="image8" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                  <form id="upload_img_form9" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片9：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,9);return false;"   name="imagef9" id="imagef9" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image9');"/>　
					                                   	<input name="image9" type="hidden" id="image9" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                  <form id="upload_img_form10" enctype="multipart/form-data" method="post" action="/uploadImg.htm">
								<tr class="td1">
											 <td style="width:12%;" valign="top"><b>图片10：</b></td>
				                              <td colspan="3">
					                                     <input type="file" onchange="uploadImg(this,10);return false;"   name="imagef10" id="imagef10" style="width: 250px;height: 50px"/>
					                                     <input  type="button" value="" class="submit btn_special btn_ll" onclick="previewImg('image10');"/>　
					                                   	<input name="image10" type="hidden" id="image10" value="" /><br />只支持JPG、GIF、PNG格式
				                              </td>
								</tr>
                                 </form>
                                 
                                 
                                <tr class="td2">
                                    <td style="width:12%;" valign="top"></td>
                                    <td colspan="3" style=" height:80px; text-align:left;">
                                        <span><a href="#" onclick="svaeTalk()"><img src="../images/btn_tj2.jpg" alt="" /></a>　<a href="talk.htm?id=${artMade.identifier}""><img src="../images/btn_fh.jpg" alt="" /></a></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
           <%@include file="../common/footer.jsp" %>
    </div>
</div>
<script type="text/javascript">
			//上传图片
			function uploadImg(self,id) {
				var filepath = $(self).val();
				var extStart = filepath.lastIndexOf(".");
				var ext = filepath.substring(extStart, filepath.length).toUpperCase();
				if (ext != ".PNG" && ext != ".JPG" && ext != ".JPEG" && ext != ".GIF") {
					alert("图片限于png,jpeg,jpg,gif格式");
					return;
				}
				$("#upload_img_form"+id).ajaxSubmit({
					dataType : 'json',
					cache : false,
					success : function(data) {
						$("#image"+id).val(data.imageServer + data.imageUrl);
					},
					error : function(err) {
						alert(err);
					}
				});
				return false;
			}
			//预览
			function previewImg(imageId) {
				var img_url = $("#" + imageId).val();
				if (!IsNull(img_url)) {
					window.open(img_url);
				} else {
					alert("没有图片，请上传！");
				}
			}
			//提交
			function svaeTalk(){
				var content =$("#content").val();
				/* if(content.length < 500){
					alert("分两次发表吧。");
					return false;
				} */
				$.post("/addTalk.htm", {
					image : $("#image10").val(),
					image1 : $("#image1").val(),
					image2 : $("#image2").val(),
					image3 : $("#image3").val(),
					image4 : $("#image4").val(),
					image5 : $("#image5").val(),
					image6 : $("#image6").val(),
					image7 : $("#image7").val(),
					image8 : $("#image8").val(),
					image9 : $("#image9").val(),
					madeId : $("#madeId").val(),
					talk: content
				},function(data){
					if(data=="success"){
						var madeId=$("#madeId").val();
						window.location.href="/talk.htm?id="+madeId;
					}
					if(data=="error"){
						alert("留言出错了。");
					}
				});
			}
 	/* function askTalk(madeId){
		window.location.href="/askTalk?id="+madeId;
	}  */
</script>
</body>
</html>
